package IC.lir.decl;

import java.util.List;

import IC.lir.operands.Label;

import IC.lir.Visitor;

/**
 * 
 * A dispatch Vector of the form:
 * 
 * name: [label1, label2, ...]
 *
 * Where labels match the pattern: _[a-zA-Z_0-9]+
 * 
 */
public class DispatchVector extends Decl {
	public final String 	name;
	public final List<Label> labels;

	/**
	 * Create a dispatch vector
	 * @param name
	 * @param labels
	 */
	public DispatchVector(String name, List<Label> labels) {
		this.name = name;
		this.labels = labels;
	}

	/**
	 * @return the labels
	 */
	public List<Label> getLabels() {
		return labels;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	@Override
	public <D, U> U accept(Visitor<D, U> v, D d) {
		return v.visit(this, d);
	}
}
